package com.lwlean.audit.controller;

import com.lwlean.audit.domain.Audit;
import com.lwlean.audit.mapper.AuditMapper;
import com.lwlean.audit.service.AuditService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * Created by lean on 16-10-11.
 */
@ComponentScan
@RestController
public class AuditController {

    @Autowired
    private AuditService auditService;

    private static final Logger logger = Logger.getLogger(AuditController.class);

    @RequestMapping(value = "/audit",method = RequestMethod.GET)
    public Object audit(){
        Audit auditById = auditService.getAuditById(Long.valueOf(1));
        logger.info("audit bean is {}"+auditById.toString());
        return auditById.toString();
    }

}
